//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.hl.sfzy.controller;

import com.hl.sfzy.entity.TollClassify;
import com.hl.sfzy.service.TollClassifyService;
import com.hl.sfzy.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping({"/toll_classify"})
public class TollClassifyController {
    @Autowired
    private TollClassifyService tollClassifyService;

    public TollClassifyController() {
    }

    @PostMapping({"/add"})
    public Result add(@RequestBody TollClassify tollClassify) throws Exception {
        this.tollClassifyService.add(tollClassify);
        return Result.success();
    }

    @GetMapping({"/find"})
    public Result find() {
        return Result.success(this.tollClassifyService.selectList());
    }

    @GetMapping({"/find/{id}"})
    public Result findById(@PathVariable Integer id) {
        return Result.success(this.tollClassifyService.findById(id));
    }
}

